package Pattern.FactoryPattern.PizzaPattern.pizzafm;

import java.util.ArrayList;

public abstract class Pizza {
    String name ;
    String dough;//面团
    String sauce;//酱料
    ArrayList<String> toppings = new ArrayList<String>();

    void prepare(){
        System.out.println("Prepare "+name);
        System.out.println("Tossing dough...");
        System.out.println("Adding sauce...");
        System.out.println("Adding topping:");
        for (String topping:toppings){
            System.out.println(" "+topping);
        }
    }
    void bake(){
        System.out.println("Bake for 25 minutes at 350");
    }

    void cut(){
        System.out.println("Cut the Pizza into diagonal slice");
    }

    void box(){
        System.out.println("Please pizza in official PizzaStore box");
    }

    public String getName(){
        return name;
    }

    @Override
    public String toString() {
        StringBuffer display = new StringBuffer();
        display.append("-----"+name+"-----\n");
        display.append(dough+"\n");
        display.append(sauce+"\n");
        for (String topping:toppings){
            display.append(topping+"\n");
        }
        return display.toString();
    }
}
